//
//  UIButton+Corner.m
//  ZDSC
//
//  Created by ZDTX on 2021/7/30.
//

#import "UIButton+Corner.h"

@implementation UIButton (Corner)

- (void)corner{
    
    self.backgroundColor = HEX_RGB(@"#B9B9B9");
    CGRect bounds = self.bounds;
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:UIRectCornerTopLeft |UIRectCornerBottomRight  cornerRadii:CGSizeMake(7, 7)];
    CAShapeLayer *maskLayer = [CAShapeLayer layer];
    maskLayer.frame = bounds;
    maskLayer.fillColor = [UIColor redColor].CGColor;
    maskLayer.path = maskPath.CGPath;
    [self.layer addSublayer:maskLayer];
    self.layer.mask = maskLayer;
}
@end
